<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center draftBox_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub draftBox_fd0_0'>
          <view class='flex flex-wrap align-center draftBox_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  draftBox_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='draftBox_fd0_0_c1_c0'>本地草稿</text>
          </view>
          <view class='flex flex-wrap align-center justify-end draftBox_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center draftBox_flex_1">
        <text class='draftBox_fd1_0'>草稿在应用卸载后会被删除，请及时发布</text>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout draftBox_flex_2">
        <template v-for='(item,key0) in columnList'>
          <view class='flex flex-direction flex-wrap align-stretch draftBox_fd2_0' :key='key0'
            @click.stop="editPost(item)">
            <view class='flex flex-wrap align-center'>
              <text class='draftBox_fd2_0_c0_c0'>{{item.title}}</text>
            </view>
            <view class='flex flex-wrap align-center draftBox_fd2_0_c1'>
              <text class='draftBox_fd2_0_c1_c0'>{{item.content}}</text>
            </view>
            <view class='flex flex-wrap align-center justify-between draftBox_fd2_0_c2'>
              <view class='flex flex-wrap align-center'>
                <text class='draftBox_fd2_0_c2_c0_c0'>{{item.create_time}}</text>
                <text class='draftBox_fd2_0_c2_c0_c1'>{{item.type_name}}</text>
              </view>
              <image class='draftBox_fd2_0_c2_c1' mode="aspectFit" :src='STATIC_URL+"41.png"'
                @tap.stop="showPopFunc(item.aid)"></image>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1706719188336" :mask="true" :mask-close-able="false" mode='center' :z-index='999'>
        <!---二次确定flex布局开始-->
        <view class="flex benben-flex-layout flex-wrap align-center">
          <view class='flex flex-direction flex-wrap align-center draftBox_fd3_0'>
            <text class='draftBox_fd3_0_c0'>提示</text>
            <text class='draftBox_fd3_0_c1'>确认删除此稿子吗？</text>
            <view class='flex align-center draftBox_fd3_0_c2'>
              <button class='draftBox_fd3_0_c2_c0' @tap.stop="popupShow1706719188336=false">取消</button>
              <button class='draftBox_fd3_0_c2_c1' @tap.stop="deleteFunc()">确认</button>
            </view>
          </view>
        </view>

        <!---二次确定flex布局结束-->

      </benben-popup>


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "popupShow1706719188336": false,
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "columnList": [],
        "aid": "",
        "type": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        type
      } = options
      if (type !== undefined) this.type = type
      this.getColumnFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.getColumnFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      editPost(item) {
        if (item.type == 1) {
          uni.navigateTo({
            url: `/pages/fabu/postApost/postApost?aid=${item.aid}&type=1`
          })
          return;
        }
        if (item.type == 2) {
          uni.navigateTo({
            url: `/pages/fabu/postApost/postApost?aid=${item.aid}&type=2`
          })
          return;
        }
        if (item.type == 3) {
          uni.navigateTo({
            url: `/pages/fabu/groupBureau/groupBureau?aid=${item.aid}`
          })
          return;
        }

      },
      //获取草稿列
      getColumnFunc() {
        this.minixPagingListsApi = global.apiUrls.post657bbb39b0fd1;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          type: this.type
        }
        this.listData = [];
        this.columnList = this.listData;
        this.pagingListToggle();

      },
      //删除帖子问答
      async deleteFunc() {
        //请求方法
        //数据验证

        let data657bbc049f559 = await this.$api.post(global.apiUrls.post657bbc049f559, {
          aid: this.aid,
        });

        if (data657bbc049f559.data.code != 1) {
          this.$message.info(data657bbc049f559.data.msg);
          return
        }
        this.popupShow1706719188336 = false;
        this.getColumnFunc()
      },
      //显示弹窗
      showPopFunc(aid) {
        this.aid = aid;
        this.popupShow1706719188336 = true;
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
  }

  .draftBox_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .draftBox_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .draftBox_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .draftBox_fd0_0_c0 {
    width: 120rpx;
  }

  .draftBox_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .draftBox_flex_1 {
    background: rgba(255, 137, 46, 0.2);
    padding: 15rpx 32rpx 15rpx 32rpx;
    background-size: 100% auto;
  }

  .draftBox_fd1_0 {
    color: #FF892E;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 44rpx;
  }

  .draftBox_flex_2 {
    padding: 24rpx 32rpx 0rpx 32rpx;
  }

  .draftBox_fd2_0_c2_c1 {
    width: 28rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .draftBox_fd2_0_c2_c0_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .draftBox_fd2_0_c2_c0_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 12rpx 0rpx 0rpx;
  }

  .draftBox_fd2_0_c2 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .draftBox_fd2_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 44rpx;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .draftBox_fd2_0_c1 {
    margin: 20rpx 0rpx 0rpx 0rpx;
  }

  .draftBox_fd2_0_c0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .draftBox_fd2_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 24rpx 0rpx;
    padding: 32rpx 24rpx 32rpx 24rpx;
  }

  .draftBox_fd3_0_c2_c1 {
    background: rgba(255, 255, 255, 1);
    font-size: 32rpx;
    color: var(--benbenFontColor5);
    width: 270rpx;
    height: 101rpx;
    line-height: 101rpx;
    font-weight: 500;
  }

  .draftBox_fd3_0_c2_c0 {
    border-right: 1px solid #eee;
    background: #fff;
    font-size: 32rpx;
    color: rgba(153, 153, 153, 1);
    width: 270rpx;
    height: 101rpx;
    line-height: 101rpx;
    font-weight: 400;
  }

  .draftBox_fd3_0_c2 {
    border-top: 1px solid #eee;
    margin: 51rpx 0rpx 0rpx 0rpx;
  }

  .draftBox_fd3_0_c1 {
    line-height: 44rpx;
    font-size: 28rpx;
    font-weight: 500;
    color: #333333;
    text-align: center;
    margin: 32rpx 40rpx 0rpx 40rpx;
  }

  .draftBox_fd3_0_c0 {
    line-height: 44rpx;
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    margin: 40rpx 0rpx 0rpx 0rpx;
  }

  .draftBox_fd3_0 {
    background: #fff;
    width: 540rpx;
    background-size: 100% auto !important;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }
</style>
